package com.eshop.product.mapper;

import com.eshop.product.model.Category;
import org.apache.ibatis.annotations.*;

/**
 * @ClassName CategoryMapper
 * @Description
 * @Author 47980
 * @Date 2020/5/17 16:08
 * @Version V_1.0
 **/
@Mapper
public interface CategoryMapper {

    @Insert("INSERT INTO category(name,description) VALUES(#{name},#{description})")
    public void add (Category category);

    @Update("UPDATE category SET name=#{name},description=#{description} WHERE id=#{id}")
    public void update(Category category);

    @Delete("DELETE FROM category WHERE id=#{id}")
    public void delete(Long id);

    @Select("SELECT * FROM category where id=#{id}")
    public Category findById(Long id);
}
